home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sheriffa / sheriff.h < prev    next >
C/C++ Source or Header  |  1999-05-17  |  2KB  |  71 lines

  1. // This is a part of the Sheriff System Development Kit.
  2. // Copyright (C) 1997-1998 Acudata Limted.
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Sheriff System Development Kit and related
  7. // electronic documentation provided with the SDK.
  8.  
  9. #ifndef SHERIFF_H
  10. #define SHERIFF_H
  11.  
  12. #include "slsapi.h"
  13.  
  14. class CSheriff
  15. {
  16. private:
  17.     SLS_HANDLE    m_hLicence;            //Licence Handle
  18.     HRESULT        m_lLastError;        //Last Error Code
  19.     CString        m_strUserName;
  20.     CString        m_strProductID;
  21.     SLS_SECRET    m_arySecrets[4];
  22.     BOOL        m_bSecretsSet;
  23.  
  24. public:
  25.     CSheriff(LPCTSTR lpszProductID,LPCTSTR lpszUserName);
  26.     ~CSheriff();
  27.  
  28.     void    SetSecrets(SLS_SECRET *parySecrets,int nSizeSecrets=4);
  29.     BOOL    Succeeded()    { return SUCCEEDED(m_lLastError); }
  30.     HRESULT    GetLastError() { return m_lLastError; }
  31.     void    GetLastErrorMessage(CString &strError);
  32.  
  33. public:
  34.     BOOL QueryLicenceInfo(SLS_LICENCE_INFO &licInfo);
  35.     BOOL GetReference(CString &strReference);
  36.     BOOL SetLicence(LPCSTR pszReference,LPCTSTR lpszLicenceKey);
  37.  
  38.     //Interface
  39.     BOOL Register(LPCTSTR lpszProductName,
  40.                   LPCTSTR lpszLicencePath);    
  41.     BOOL License(SLS_LICENCE Licence);
  42.     BOOL Request(SLS_REQUEST Request,SLS_PERMIT &Permit);
  43.     BOOL Update(SLS_UPDATE Update,SLS_PERMIT &Permit);
  44.     BOOL Release(SLS_RELEASE Release);
  45.  
  46.     //Attribute
  47.     BOOL IsProductInstalled();
  48.     BOOL IsProductRegistered();
  49.     BOOL IsProductLicensed();
  50.  
  51.     BOOL IsLicenceDefined();
  52.     BOOL IsLicenceValid();
  53.     BOOL IsLicenceExportable();
  54.  
  55.     BOOL IsLifetimeKey();
  56.     BOOL IsLifetimeRef();
  57.     BOOL IsStandaloneKey();
  58.  
  59.     //Options
  60.     BOOL SetOptions(SLS_OPTIONS Options);
  61.  
  62.     //Utilities
  63.     BOOL Export(SLS_LICENCE Licence,LPCTSTR lpszExportRef,CString &strExportKey);
  64.     BOOL Import(LPCSTR pszReference,LPCTSTR lpszLicenceKey);
  65.  
  66.     DWORD GetUserCount();
  67.     BOOL  QueryUserInfo(DWORD dwUserIndex,SLS_USER_INFO &userInfo);
  68. };
  69.  
  70. #endif
  71.